import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from "@/components/page/Login";
import Register from "@/components/page/Register";
import Home from "@/components/common/Home";
import Community from "@/components/page/community/Community";
import Shop from "@/components/page/shop/Shop";
import My from "@/components/page/my/My";
import MainPage from "@/components/page/mainpage/MainPage";
import BaikeDetailPage from "@/components/page/mainpage/BaikeDetailPage";
import CheckMyDiary from "@/components/page/my/CheckMyDiary";
import ArticlePage from "@/components/page/community/ArticlePage";
import PlantCastle from "@/components/page/community/PlantCastle";
import HelpPage from "@/components/page/community/HelpPage";
Vue.use(VueRouter)

const routes = [
  {
    path:'/Login',
    name:'Login',
    component:Login
  },
  {
    path: '/Register',
    name: 'Register',
    component: Register
  },
  {
    path: '/BaikeDetailPage',
    component: BaikeDetailPage,
    meta: {
      auth: true
    },
    name: 'BaikeDetailPage'
  },
  {
    path: '/CheckMyDiary',
    component: CheckMyDiary,
    meta: {
      auth: true
    },
    name: 'CheckMyDiary'
  },
  {
    path: '/HelpPage',
    component: HelpPage,
    meta: {
      auth: true
    },
    name: 'HelpPage'
  },
  {
    path: '/',
    name:'Home',
    component: Home,
    children:[
      {
        path:'/MainPage',
        name: 'MainPage',
        component: MainPage
      },
      {
        path: '/Community',
        name:'Community',
        component: Community
      },
      {
        path: '/Shop',
        name:'Shop',
        component: Shop
      },
      {
        path: '/My',
        name:'My',
        component: My
      },
      {
        path:'/ArticlePage',
        name: 'ArticlePage',
        component: ArticlePage
      },
      {
        path:'/PlantCastle',
        name: 'PlantCastle',
        component: PlantCastle
      },
      // {
      //   path:'/Login',
      //   name:'Login',
      //   component:Login
      // },
    ]
  },

]

const router = new VueRouter({
  routes
})

export default router
